<template>
	<view class="search_box" >
		<view class="search_box_input">
			<view class="search_box_input_right" @click="search">
				<u-icon name="search" color="#717683" size="32"></u-icon>
			</view>
			<input class="search_box_input_left" @confirm="search"  type="text" v-model="search_text" placeholder="请输入关键词查询" />
			<view class="search_submit" @click="search">
				搜索
			</view>
		</view>
		<searchList ref="search_list" @item_chagne="tosearch"></searchList>
	</view>
</template>

<script>
	import searchList from '@/componts/index_comp/search_list.vue';
	export default {
		components:{
		   searchList
		},
		props: {
			// 缺省图
			style_item: {
				type: Object,
				default: () => ({})
			},
		},
		data() {
			return {
				search_text:''
			}
		},
		mounted() {
			this.getList()
		},
		methods: {
			tosearch(e){
				this.$emit('search_change' , e)
			},
			search(){
				this.$emit('search_change' , this.search_text)
			},
			getList(){
				this.$refs.search_list.getList()
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import url(./search.css);
</style>